package com.gitee.hljdrl.dsbridge.basis;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;

import androidx.annotation.IdRes;

public interface ViewPresenter {

    Activity getActivity();

    void initView();

    void initEvent();

    <T extends View> T findViewById(@IdRes int id);

    void onCreate(Activity activity);

    void onCreate(Activity activity, View view, Bundle bundle);

    void onResume();

    void onPause();

    void onDestroy();

    void onConfigurationChanged(Configuration newConfig);

    default boolean onBackPressed(){
        return false;
    }

    default boolean onKeyDown(int keyCode, KeyEvent event){
        return false;
    }

    void onActivityResult(int requestCode, int resultCode,Intent data);
}
